package com.remainder.sdk.export.mapper;

import org.apache.ibatis.annotations.*;

import com.remainder.sdk.export.domain.ExportLog;

/**
 * 导出日志Mapper接口
 *
 * @author qiaomignzhi
 * @date 2023-06-13
 */
@Mapper
public interface ExportLogMapper {

    /**
     * 新增导出日志
     *
     * @param exportLog
     *            导出日志
     * @return 结果
     */
    @Insert("insert into biz_export_log (batch_number,operator_id,operator_name,export_source,total,batch_size,remain_Batch,status,operating_source,"
        + "gmt_create) values(#{batchNumber},#{operatorId},#{operatorName},#{exportSource},#{total},#{batchSize},#{remainBatch},#{status},"
        + "#{operatingSource},#{gmtCreate})")
    @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
    int insertExportLog(ExportLog exportLog);

    /**
     * 修改导出日志
     *
     * @param exportLog
     *            导出日志
     * @return 结果
     */
    @Update("" + "update biz_export_log set " + "remain_batch = #{exportLog.remainBatch}, "
        + "batch_size = #{exportLog.batchSize}, " + "export_type = #{exportLog.exportType}, "
        + "export_details = #{exportLog.exportDetails}, " + "status = #{exportLog.status}, "
        + "gmt_modified = #{exportLog.gmtModified} " + "where id = #{exportLog.id}" + "")
    int updateExportLog(@Param("exportLog") ExportLog exportLog);

}
